//
//  BaseNavController.m
//  TCProject
//
//  Created by admin on 16/1/18.
//  Copyright © 2016年 wise-wing. All rights reserved.
//

#import "BaseNavController.h"

@interface BaseNavController ()

@end

@implementation BaseNavController


+ (void)initialize{
    UINavigationBar *navBar = [UINavigationBar appearance];
    navBar.barTintColor = kGlobalColor;
    navBar.tintColor = [UIColor whiteColor];
    [navBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    
}

- (instancetype)initWithRootViewController:(UIViewController *)rootViewController{
    if (self = [super initWithRootViewController:rootViewController]) {
        
    }
    return self;
}

- (UIStatusBarStyle) preferredStatusBarStyle{
    return UIStatusBarStyleLightContent;
}

- (void) pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    viewController.navigationItem.leftBarButtonItem = [self createBackItem];
    [super pushViewController:viewController animated:YES];
}

- (UIBarButtonItem *)createBackItem{
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back"] style:UIBarButtonItemStyleDone target:self action:@selector(back)];
    return item;
}

- (void) back{
    [self popViewControllerAnimated:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
   
}


@end
